﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System;
using System.Collections.Generic;
using Sebastof.Services.Interfaces;

#endregion

namespace InterLinq.Test {
	/// <summary>
	/// Represents a order that contains n order positions
	/// </summary>
	[Serializable]
	public class InterLinqOrder : SebastofApplicationObject, IOrder {
		#region Public Properties

		/// <summary>
		/// Gets the order position of the order
		/// </summary>
		public IList<IOrderPosition> OrderPositions {
			get { return GetValue<IList<IOrderPosition>>("OrderPositions"); }
			private set { SetValue("OrderPositions", value); }
		}

		/// <summary>
		///  gets the name of the order
		/// </summary>
		public string Name {
			get { return GetValue<String>("Name"); }
			set { SetValue("Name", value); }
		}

		#endregion

		#region Public Methods

		public InterLinqOrder() {
			OrderPositions = new List<IOrderPosition>();
			Id = Guid.NewGuid().ToString();
			Name = Id;
		}

		#endregion

		#region IOrder Members

		Guid IOrder.Id {
			get { return new Guid(base.Id); }
		}

		#endregion
	}
}